<p>
  Hi <%= @user.nickname %>
</p>

<% unless @user.optin? %>
<hr>
<p>
  We have updated our <a href='https://libraries.io/terms'>terms of service</a> and <a href='https://libraries.io/privacy'>privacy policy</a>. If you do not accept these changes <b>your account will be removed</b> at some point in the future.
</p>
<p>
  <%= link_to 'Click here to read and accept the new terms of service and privacy policy', account_url %>
</p>
<hr>
<% end %>

<p>
  I detected that version <%= link_to @version.number, version_url(@project.to_param.merge(number: @version.number)) %>
  of <%= link_to @project, project_url(@project.to_param) %> was released
  on <%= @project.platform_name %>
  <% if @version.published_at.present? %>
  at <%= @version.published_at.to_s(:long) %>
  <% end %>
</p>

<% if @repos.any? %>
<p>
  You depend on <%= @project %> in the following repos:
  <%= @repos.map{|repo| link_to repo.full_name, repository_url(repo.to_param) }.to_sentence.html_safe %>
</p>
<% end %>

<p>
  Check out all the details here: <%= link_to version_url(@project.to_param.merge(number: @version.number)), version_url(@project.to_param.merge(number: @version.number)) %>
</p>

<% if @project.repository.present? %>
  <% if @version.related_tag %>
    <p>
      Browse the code for <%= @version %> on <%= @project.repository.formatted_host %>: <%= link_to @version.repository_url, @version.repository_url %>
    </p>
    <% if @version.previous_version %>
      <p>
        View diff between <%= @version %> and <%= @version.previous_version %>: <%= link_to @version.diff_url, @version.diff_url %>
      </p>
    <% end %>
  <% else %>
    <p>
      You can also browse the latest commits on <%= @project.repository.formatted_host %>: <%= link_to @project.repository.commits_url, @project.repository.commits_url %>
    </p>
  <% end %>
<% end %>

<p>
  From your friendly neighborhood robot, Libby.
</p>
<hr>
<p>
  <em>p.s. You can unsubscribe from notifications about <%= @project %> here: <%= link_to unsubscribe_project_url(@project.to_param), unsubscribe_project_url(@project.to_param) %></em>
  <em>You can opt out of emails from your account here: <%= link_to account_url, account_url %></em>
</p>
